Ext.define('archives.view.base.GridView', {
	extend : 'archives.view.base.Grid',
	border : false,

	store : Ext.emptyString,
	columns : Ext.emptyString,

	hideBaseFilter : true,
	hasColModifyOper : true, 
	hasColDetailOper : true,
	extendColOper : Ext.emptyString,
	
	hasBaseToolBar : true,
	rightToolBar : Ext.emptyString,
	extendToolBar : Ext.emptyString,

	getCol : function()
	{
		var me = this;

		var colOper = [];
		
		if (me.hasColModifyOper)
		{
			colOper.push({
							icon : 'resources/images/modify.gif',
							itemId : 'modifyRec',
							tooltip : _('Modify'),
							handler : function(grid, rowIndex,colIndex) {
								this.up('grid').fireEvent('modifyRec', rowIndex);
							}
						});
		};
		if (me.hasColDetailOper)
		{
			 colOper.push({
							icon : 'resources/images/details.gif',
							itemId : 'detailRec',
							tooltip : _('Detail'),
							handler : function(grid, rowIndex,colIndex) {
								this.up('grid').fireEvent('detailRec', rowIndex);
							}
						});
		}

		 colOper = colOper.concat(me.callParent());
		
		return colOper;
	},
	getToolBar : function()
	{
		var me = this;

		var toolbar = [];
		
		if (me.hasBaseToolBar) {
			var tbar = [{
				xtype : 'button',
				itemId : 'btnAdd',
				text : _('Add'),
				icon : 'resources/images/add.gif',
				handler : function() {
					this.up('grid').fireEvent('add', this, toolbar,
							this.up('grid'));
				}
			}, {
				xtype : 'button',
				itemId : 'btnModify',
				text : _('Modify'),
				icon : 'resources/images/modify.gif',
				handler : function() {
					this.up('grid').fireEvent('modify', this, toolbar,
							this.up('grid'));
				}
			}, {
				xtype : 'button',
				itemId : 'btnRemove',
				text : _('Remove'),
				icon : 'resources/images/remove.gif',
				handler : function() {
					this.up('grid').fireEvent('remove', this, toolbar,
							this.up('grid'));
				}
			}, {
				xtype : 'button',
				itemId : 'btnFilter',
				text : _('Filter'),
				hidden : this.hideBaseFilter,
				icon : 'resources/images/filter.png',
				handler : function() {
					this.up('grid').fireEvent('filter', this, toolbar,
							this.up('grid'));
				}
			}];
			toolbar = toolbar.concat(tbar);
		}
		
		toolbar = toolbar.concat(me.callParent());
		
		return toolbar;
	}
})
